﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ERPWebDemos.Tools
{
    public partial class DeleteRecord : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Clear();
            bool success = false;
            string tableName = Request["table"];
            string filter = Request["filter"];
            if (tableName != null && tableName != string.Empty && filter !=null &&　filter !=string.Empty )
            {
                string sqlText = "delete from dbo.["+tableName +"] where "+filter ;
                int count = RuleCode.Common.SqlHelper.Instance.ExecuteNonQuery(System.Data.CommandType.Text, sqlText);
                success =(count >0);
            }
            Response.Write(success);
            Response.End();
        }
    }
}
